In a known bending angle detection system incorporated in a bending machine such as a press brake, a slit light or two spot lights are directed to a surface of a workpiece; a linear projected light image formed on the workpiece surface by the slit or spot light is picked up by a pickup means; and the picked up image is processed, whereby a bending angle of a workpiece is detected. For instance, Japanese Patent Publication (KOKAI) No. 7-239221 (1995) discloses a system for determining a bending angle of a workpiece. According to this publication, a linear projected light image picked up by a pickup means is processed with a known image processing technique. Specifically, the linear projected light image is digitized to form a binary image using an appropriate threshold, the binary image is thinned to have one pixel width, and then the thinned straight line having one pixel width is represented by a sequence of points (x, y), treating one pixel as a unit. From this image composed of a sequence of points, a linear equation ax+by+c=0 is calculated, using the least squares method or the like. If the length of the straight line obtained from the calculation exceeds a specified value H (e.g., one half the length of the screen), this straight line is determined as the points on the workpiece to be extracted. The inclination angle and position of this straight line on the screen is calculated, thereby determining the bending angle of the workpiece.
However, the bending angle detection system of Japanese Patent Publication No. 7-239221 reveals the following problems. Concretely, when detecting a bending angle of a workpiece having a hole as shown in FIGS. 12(a) and 12(b), three types of line segments u, v, w as shown in FIGS. 12(c) are recognized. Since any of these line segments does not have a length exceeding the specified length H, there occurs an error in the measurement of the bending angle of the workpiece. To cope with this situation, it is conceivable to select the length of the longest line segment as the specified length H. However, if the line segment v corresponding to the hole is longer than the line segments u, w which respectively correspond to a solid part of the workpiece, the line segment corresponding to the hole is extracted, so that the bending angle of the workpiece cannot be accurately measured. In cases where the line segment u corresponding to a solid part is the longest, only the line segment u is extracted as a bright line data to be utilized in the bending angle measurement, and therefore the amount of data used for the measurement is small, compared to the measurement based on the two line segments u and w which originally constitute one line. A small amount of data also leads to poor detection accuracy.
There arises another problem when detecting a bending angle of a workpiece having a short leg as shown in FIGS. 13(a) and 13(b). In this case, two types of line segments, that is, a line segment s which corresponds to the light projected onto the workpiece and a line segment t which corresponds to the light projected onto the punch (upper die) are recognized, as shown in FIG. 13(c). As the line segment s is shorter than the specified length H because of the short leg of the workpiece, the line segment t is recognized as the line to be used for the measurement by mistake, which results in a failure in bending angle detection.
With a view to overcoming the above problems, Japanese Patent Publication No. 7-239221 proposes techniques for excluding data on bright lines formed on other areas than the workpiece. They are (1) a method for eliminating noise by performing arithmetic operation on images obtained before and after projection of a slit light or the like and (2) a method for eliminating noise by making brightness values equal to or lower than a predetermined threshold zero. These methods, however, have their respective disadvantages. In the method (1), a bright line formed on the fixed part of the die (lower die) etc. is erasable by the arithmetic operation on the images but it is difficult to eliminate a bright line formed on the movable part of the punch (upper die) etc. by the arithmetic operation. In the method (2), the threshold should be changed according to reflectance which varies with ambient light, the surface condition of the workpiece and other factors and according to the instrumental errors of the pickup device, which gives rise to difficulty in determining the threshold. The publication teaches that, in order to more effectively carry out the method (2), reflected light from other areas than the workpiece is weakened by applying surface treatment (e.g., painting) to machine parts so that undesirable data due to reflected light from the machine parts can be made to be lower than the threshold. However, this attempt reveals the problem that the paint comes off after use, with the result that reflected light from the machine parts gradually increases.
The present invention is directed to overcoming the foregoing problems, and one of the objects of the invention is therefore to provide a bending angle detection system capable of detecting a bending angle of a workpiece with high accuracy, wherein taking into account the fact that the brightness of a linear image formed on a surface of a workpiece is higher than that of a linear image formed on other areas than the workpiece, linear images picked up from the workpiece are automatically sorted out from linear images picked up from other areas according to differences in the brightness values of the linear images so that only the data representative of the linear images formed on the workpiece can be extracted.